/*
 * BotonSingleMulti.cpp
 *
 *  Created on: 18/11/2012
 *      Author: Leo
 */

#include "BotonSingleMulti.h"
#include "../constantes.h"
#include <iostream>

using namespace std;

BotonSingleMulti::BotonSingleMulti(SDL_Rect box){

	this->caja = box;
	this->fondo = NULL;
}

void BotonSingleMulti::setFondo(SDL_Surface* f){
	this->fondo = f;
}

bool BotonSingleMulti::escucharEventos(SDL_Event* evento){

	if(evento->type == SDL_MOUSEBUTTONDOWN && evento->button.button == SDL_BUTTON_LEFT) {
	        int x = evento->button.x;
	        int y = evento->button.y;

	         if(x <= this->caja.w+this->caja.x && x >= this->caja.x && y <= this->caja.h +this->caja.y && y >= this->caja.y){
	        	 return true;
	         }
	}
	return false;
}

BotonSingleMulti::~BotonSingleMulti(){}


